/*    */ package com.zimbra.cs.service.mail;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class InvalidateReminderDevice
/*    */   extends MailDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 36 */     String emailAddr = request.getAttribute("a");
/* 37 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 38 */     Account account = getRequestedAccount(zsc);
/* 39 */     String configuredAddr = account.getCalendarReminderDeviceEmail();
/* 40 */     if (emailAddr.equals(configuredAddr)) {
/* 41 */       account.unsetCalendarReminderDeviceEmail();
/*    */     } else {
/* 43 */       throw ServiceException.INVALID_REQUEST("Email address'" + emailAddr + "' is not same as the " + "zimbraCalendarReminderDeviceEmail" + " attr value '" + configuredAddr + "'", null);
/*    */     }
/*    */     
/*    */ 
/* 47 */     return zsc.createElement(MailConstants.INVALIDATE_REMINDER_DEVICE_RESPONSE);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/mail/InvalidateReminderDevice.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */